import {ApiUri} from "@/api/base/ApiPath";
import {get, post} from "./base/http";

let ApiPath = new ApiUri();

export class DataManage {
    /**
     * 获取表名
     * @constructor
     */
    static FindSystemDatabaseTableNames() {
        return get(ApiPath.DataManage.TABLE_NAME)
    }

    /**
     * 获取表结构和列别名
     * @param TableName
     * @param callback
     * @constructor
     */
    static FindTableStructures(TableName: string) {
        return get(ApiPath.DataManage.TABLE_STRUCTURE, {TableName: TableName})
    }

    static QueryBySql(Sql: string) {
        return post(ApiPath.DataManage.QUERY_BY_SQL, {Sql: Sql})
    }

    static PageBySql(Sql: string, TableName: string, Page: string, Size: string) {
        return post(ApiPath.DataManage.PAGE_QUERY_BY_SQL, {Sql: Sql, TableName: TableName, Page: Page, Size: Size})
    }

    static ExecuteSql(Sql: string) {
        return post(ApiPath.DataManage.EXECUTE_SQL, {Sql: Sql})
    }
}
